package com.igeekhome.ccs.biz.impl;

import com.igeekhome.ccs.biz.ICommonWordsCategoryBiz;
import com.igeekhome.ccs.entity.CommonWords;
import com.igeekhome.ccs.entity.CommonWordsCategory;
import com.igeekhome.ccs.mapper.CommonWordsCategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommonWordsCategorybizImpl implements ICommonWordsCategoryBiz {
//👇张煜涵---------------------------------------------------------------------
    @Autowired
    CommonWordsCategoryMapper commonWordsCategoryMapper;

    //查询公共库所有分类对象
    @Override
    public List<CommonWordsCategory> queryPublicLib() {
        return commonWordsCategoryMapper.queryPublicLib();
    }

    //查询个人库所有分类对象
    @Override
    public List<CommonWordsCategory> queryPrivateLib(int csId) {
        return commonWordsCategoryMapper.queryPrivateLib(csId);
    }

    //通过分类ID拿到所有的常用语对象
    @Override
    public List<CommonWords> queryCwByCategoryId(int categoryId) {
        return commonWordsCategoryMapper.queryCwByCategoryId(categoryId);
    }

    //新增分类
    @Override
    public int createCwc(CommonWordsCategory commonWordsCategory) {
        commonWordsCategoryMapper.createCwc(commonWordsCategory);
        return 0;
    }
//👆张煜涵---------------------------------------------------------------------
}
